﻿#ifndef DANODEMETADATA_H
#define DANODEMETADATA_H
#include "DAWorkFlowGlobal.h"
#include <QtCore/qglobal.h>
#include <QIcon>

/**
 * @brief 保存节点元数据
 * 节点元数据由工厂进行管理
 * @note 节点元数据的hash和小于操作都是针对NodePrototype，因此要保证
 */
class DAWORKFLOW_API DANodeMetaData
{
public:
    DANodeMetaData();
    DANodeMetaData(const QString &prototype);
    DANodeMetaData(const QString &prototype, const QString &name, const QIcon &icon, const QString &group);
    // ptototype
    QString getNodePrototype() const;
    void setNodePrototype(const QString &prototype);

    //节点名
    QString getNodeName() const;
    void setNodeName(const QString &name);

    //图标
    QIcon getIcon() const;
    void setIcon(const QIcon &icon);

    //所属分组
    QString getGroup() const;
    void setGroup(const QString &group);

private:
    QString m_prototype;
    QString m_nodeName;
    QIcon m_nodeIcon;
    QString m_group;
};
Q_DECLARE_METATYPE(DANodeMetaData)

DAWORKFLOW_API uint qHash(const DANodeMetaData &key, uint seed = 0);
DAWORKFLOW_API bool operator<(const DANodeMetaData &a, const DANodeMetaData &b);
DAWORKFLOW_API bool operator==(const DANodeMetaData &a, const DANodeMetaData &b);

#endif // FCNODEMETADATA_H
